`:top
`!Elixir`! is a `F33f`_`[functional`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Functional_programming]`_`f, `F33f`_`[concurrent`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Concurrent_computing]`_`f, `F33f`_`[high-level`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=High-level_programming_language]`_`f `F33f`_`[general-purpose`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=General-purpose_programming_language]`_`f `F33f`_`[programming language`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Programming_language]`_`f that runs on the `F33f`_`[BEAM`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=BEAM_(Erlang_virtual_machine)]`_`f `F33f`_`[virtual machine`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Virtual_machine]`_`f, which is also used to implement the `F33f`_`[Erlang`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Erlang_(programming_language)]`_`f programming language.`:cite-ref-0-3-0[`F5bf`_`[3`#cite-note-0-3]`_`f] Elixir builds on top of Erlang and shares the same abstractions for building `F33f`_`[distributed`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Distributed_computing]`_`f, `F33f`_`[fault-tolerant`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Fault-tolerant]`_`f applications. Elixir also provides tooling and an `F33f`_`[extensible`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Extensible]`_`f design. The latter is supported by compile-time `F33f`_`[metaprogramming`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Metaprogramming]`_`f with `F33f`_`[macros`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Macro_(computer_science)]`_`f and `F33f`_`[polymorphism`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Polymorphism_(computer_science)]`_`f via protocols.`:cite-ref-4[`F5bf`_`[4`#cite-note-4]`_`f]
The community organizes yearly events in the United States,`:cite-ref-5[`F5bf`_`[5`#cite-note-5]`_`f] Europe,`:cite-ref-6[`F5bf`_`[6`#cite-note-6]`_`f] and Japan,`:cite-ref-7[`F5bf`_`[7`#cite-note-7]`_`f] as well as minor local events and conferences.`:cite-ref-8[`F5bf`_`[8`#cite-note-8]`_`f]`:cite-ref-9[`F5bf`_`[9`#cite-note-9]`_`f]
>>Contents
• `F0af`_`[History`#history]`_`f
• `F0af`_`[Versioning`#versioning]`_`f
• `F0af`_`[Features`#features]`_`f
• `F0af`_`[Examples`#examples]`_`f
• `F0af`_`[See also`#see-also]`_`f
• `F0af`_`[References`#references]`_`f
• `F0af`_`[Further reading`#further-reading]`_`f
-─
>>History
José Valim created the Elixir programming language as a `F33f`_`[research and development`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Research_and_development]`_`f project at Plataformatec. His goals were to enable higher extensibility and productivity in the Erlang VM while maintaining compatibility with Erlang's ecosystem.`:cite-ref-10[`F5bf`_`[10`#cite-note-10]`_`f]`:cite-ref-11[`F5bf`_`[11`#cite-note-11]`_`f]
Elixir is aimed at large-scale sites and apps. It uses features of `F33f`_`[Ruby`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Ruby_(programming_language)]`_`f, Erlang, and `F33f`_`[Clojure`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Clojure]`_`f to develop a high-concurrency and low-latency language. It was designed to handle large data volumes. Elixir is also used in telecommunications, e-commerce, and finance.`:cite-ref-12[`F5bf`_`[12`#cite-note-12]`_`f]
In 2021, the Numerical Elixir effort was announced with the goal of bringing machine learning, neural networks, GPU compilation, data processing, and computational notebooks to the Elixir ecosystem.`:cite-ref-13[`F5bf`_`[13`#cite-note-13]`_`f]
>>Versioning
Each of the minor versions supports a specific range of Erlang/`F33f`_`[OTP`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Open_Telecom_Platform]`_`f versions.`:cite-ref-14[`F5bf`_`[14`#cite-note-14]`_`f] The current stable release version is 1.18.4`:cite-ref-wikidata-38d73dbc67fe379aec44b4c951a0b1d72113a0cd-v20-1-1[`F5bf`_`[1`#cite-note-wikidata-38d73dbc67fe379aec44b4c951a0b1d72113a0cd-v20-1]`_`f] .
>>Features
• `F33f`_`[Compiles`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Compiler]`_`f to `F33f`_`[bytecode`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Bytecode]`_`f for the `F33f`_`[BEAM virtual machine`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=BEAM_(Erlang_virtual_machine)]`_`f of `F33f`_`[Erlang`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Erlang_(programming_language)]`_`f.`:cite-ref-elixirhome-15-0[`F5bf`_`[15`#cite-note-elixirhome-15]`_`f] Full interoperability with Erlang code, without `F33f`_`[runtime`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Runtime_(program_lifecycle_phase)]`_`f impact.
• Scalability and fault-tolerance, thanks to Erlang's lightweight concurrency mechanisms`:cite-ref-elixirhome-15-1[`F5bf`_`[15`#cite-note-elixirhome-15]`_`f]
• `F33f`_`[Built-in tooling`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Mix_(build_tool)]`_`f for managing dependencies, code compilation, running tests, formatting code, remote debugging and more.
• An interactive `F33f`_`[REPL`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Read–eval–print_loop]`_`f inside running programs, including `F33f`_`[Phoenix`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Phoenix_(web_framework)]`_`f web servers, with code reloading and access to internal state
• Everything is an `F33f`_`[expression`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Expression_(computer_science)]`_`f`:cite-ref-elixirhome-15-2[`F5bf`_`[15`#cite-note-elixirhome-15]`_`f]
• `F33f`_`[Pattern matching`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Pattern_matching]`_`f`:cite-ref-elixirhome-15-3[`F5bf`_`[15`#cite-note-elixirhome-15]`_`f] to promote assertive code`:cite-ref-16[`F5bf`_`[16`#cite-note-16]`_`f]
• Type hints for static analysis tools
• Immutable data, with an emphasis, like other `F33f`_`[functional`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Functional_programming]`_`f languages, on `F33f`_`[recursion`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Recursion_(computer_science)]`_`f and `F33f`_`[higher-order functions`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Higher-order_function]`_`f instead of `F33f`_`[side-effect`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Side-effect_(computer_science)]`_`f-based `F33f`_`[looping`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Loop_(computing)]`_`f
• `F33f`_`[Shared nothing concurrent programming`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Shared_nothing_architecture]`_`f via message passing (`F33f`_`[actor model`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Actor_model]`_`f)`:cite-ref-17[`F5bf`_`[17`#cite-note-17]`_`f]
• `F33f`_`[Lazy`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Lazy_evaluation]`_`f and `F33f`_`[async collections`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Futures_and_promises]`_`f with streams
• Railway oriented programming via the `B100`F9d9with`f`b construct`:cite-ref-18[`F5bf`_`[18`#cite-note-18]`_`f]
• Hygienic `F33f`_`[metaprogramming`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Metaprogramming]`_`f by direct access to the `F33f`_`[abstract syntax tree`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Abstract_syntax_tree]`_`f (AST).`:cite-ref-elixirhome-15-4[`F5bf`_`[15`#cite-note-elixirhome-15]`_`f] Libraries often implement small `F33f`_`[domain-specific languages`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Domain-specific_language]`_`f, such as for databases or testing.
• Code execution at compile time. The Elixir compiler also runs on the BEAM, so modules that are being compiled can immediately run code which has already been compiled.
• `F33f`_`[Polymorphism`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Polymorphism_(computer_science)]`_`f via a mechanism called protocols. `F33f`_`[Dynamic dispatch`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Dynamic_dispatch]`_`f, as in `F33f`_`[Clojure`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Clojure]`_`f, however, without `F33f`_`[multiple dispatch`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Multiple_dispatch]`_`f because Elixir protocols dispatch on a single type.
• Support for documentation via Python-like docstrings in the `F33f`_`[Markdown`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Markdown]`_`f formatting language`:cite-ref-elixirhome-15-5[`F5bf`_`[15`#cite-note-elixirhome-15]`_`f]
• `F33f`_`[Unicode`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Unicode]`_`f support and `F33f`_`[UTF-8`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=UTF-8]`_`f strings
>>Examples
The following examples can be run in an `B100`F9d9iex`f`b `F33f`_`[shell`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Shell_(computing)]`_`f or saved in a file and run from the `F33f`_`[command line`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Command_line]`_`f by typing `B100`F9d9elixir `*<filename>`*`f`b.
Classic `F33f`_`[Hello world`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path="Hello,_World!"_program]`_`f example:
`B100`F9d9iex> IO.puts("Hello World!")`f`b
`B100`F9d9Hello World!`f`b
Pipe operator:
`B100`F9d9iex> "Elixir" |> String.graphemes() |> Enum.frequencies()`f`b
`B100`F9d9%{"E" => 1, "i" => 2, "l" => 1, "r" => 1, "x" => 1}`f`b
`B100`F9d9`f`b
`B100`F9d9iex> %{values: 1..5} |> Map.get(:values) |> Enum.map(& &1 * 2)`f`b
`B100`F9d9[2, 4, 6, 8, 10]`f`b
`B100`F9d9`f`b
`B100`F9d9iex> %{values: 1..5} |> Map.get(:values) |> Enum.map(& &1 * 2) |> Enum.sum()`f`b
`B100`F9d930`f`b
`F33f`_`[Pattern matching`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Pattern_matching]`_`f (a.k.a. destructuring):
`B100`F9d9iex> %{left: x} = %{left: 5, right: 8}`f`b
`B100`F9d9iex> x`f`b
`B100`F9d95`f`b
`B100`F9d9`f`b
`B100`F9d9iex> {:ok, [_ | rest]} = {:ok, [1, 2, 3]}`f`b
`B100`F9d9iex> rest`f`b
`B100`F9d9[2, 3]`f`b
Pattern matching with multiple clauses:
`B100`F9d9iex> case File.read("path/to/file") do`f`b
`B100`F9d9iex> {:ok, contents} -> IO.puts("found file: #{contents}")`f`b
`B100`F9d9iex> {:error, reason} -> IO.puts("missing file: #{reason}")`f`b
`B100`F9d9iex> end`f`b
`F33f`_`[List comprehension`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=List_comprehension]`_`f:
`B100`F9d9iex> for n <- 1..5, rem(n, 2) == 1, do: n*n`f`b
`B100`F9d9[1, 9, 25]`f`b
Asynchronously reading files with streams:
`B100`F9d91..5`f`b
`B100`F9d9|> Task.async_stream(&File.read!("#{&1}.txt"))`f`b
`B100`F9d9|> Stream.filter(fn {:ok, contents} -> String.trim(contents) != "" end)`f`b
`B100`F9d9|> Enum.join("\\n")`f`b
Multiple function bodies with `F33f`_`[guards`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Guard_(computer_science)]`_`f:
`B100`F9d9def fib(n) when n in [0, 1], do: n`f`b
`B100`F9d9def fib(n), do: fib(n-2) + fib(n-1)`f`b
Relational databases with the Ecto library:
`B100`F9d9schema "weather" do`f`b
`B100`F9d9 field :city # Defaults to type :string`f`b
`B100`F9d9 field :temp_lo, :integer`f`b
`B100`F9d9 field :temp_hi, :integer`f`b
`B100`F9d9 field :prcp, :float, default: 0.0`f`b
`B100`F9d9end`f`b
`B100`F9d9`f`b
`B100`F9d9Weather |> where(city: "Kraków") |> order_by(:temp_lo) |> limit(10) |> Repo.all`f`b
Sequentially spawning a thousand processes:
`B100`F9d9for num <- 1..1000, do: spawn fn -> IO.puts("#{num * 2}") end`f`b
`F33f`_`[Asynchronously`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Async/await]`_`f performing a task:
`B100`F9d9task = Task.async fn -> perform_complex_action() end`f`b
`B100`F9d9other_time_consuming_action()`f`b
`B100`F9d9Task.await task`f`b
>>See also
• `F33f`_`[Concurrent computing`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Concurrent_computing]`_`f
• `F33f`_`[Distributed computing`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Distributed_computing]`_`f
• `F33f`_`[Parallel computing`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Parallel_computing]`_`f
>>References
`:cite-note-wikidata-38d73dbc67fe379aec44b4c951a0b1d72113a0cd-v20-1`!1.`! "Release 1.18.4". 21 May 2025. Retrieved 25 May 2025.
`:cite-note-2`!1.`! "elixir/LICENSE at master · elixir-lang/elixir · GitHub". `*GitHub`*.
`:cite-note-0-3`!3.`! `F0af`_`[↑`#cite-ref-0-3-0]`_`f "Most Popular Programming Languages of 2018 - Elite Infoworld Blog". 2018-03-30. Archived from the original on 2018-05-09. Retrieved 2018-05-08.
`:cite-note-4`!4.`! `F0af`_`[↑`#cite-ref-4]`_`f "Elixir". `*José Valim`*. Retrieved 2013-02-17.
`:cite-note-5`!5.`! `F0af`_`[↑`#cite-ref-5]`_`f "ElixirConf". Retrieved 2018-07-11.
`:cite-note-6`!6.`! `F0af`_`[↑`#cite-ref-6]`_`f "ElixirConf". Retrieved 2018-07-11.
`:cite-note-7`!7.`! `F0af`_`[↑`#cite-ref-7]`_`f "Erlang & Elixir Fest". Retrieved 2019-02-18.
`:cite-note-8`!8.`! `F0af`_`[↑`#cite-ref-8]`_`f "Elixir LDN". Retrieved 2018-07-12.
`:cite-note-9`!9.`! `F0af`_`[↑`#cite-ref-9]`_`f "EMPEX - Empire State Elixir Conference". Retrieved 2018-07-12.
`:cite-note-10`!10.`! `F0af`_`[↑`#cite-ref-10]`_`f `*Elixir - A modern approach to programming for the Erlang VM`*. Retrieved 2013-02-17.
`:cite-note-11`!11.`! `F0af`_`[↑`#cite-ref-11]`_`f `*José Valim - ElixirConf EU 2017 Keynote`*. Archived from the original on 2021-11-17. Retrieved 2017-07-14.
`:cite-note-12`!12.`! `F0af`_`[↑`#cite-ref-12]`_`f "Behinde the code: The One Who Created Elixir". Retrieved 2019-11-25.
`:cite-note-13`!13.`! `F0af`_`[↑`#cite-ref-13]`_`f "Numerical Elixir (Nx)". `*`F33f`_`[GitHub`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=GitHub]`_`f`*. Retrieved 2024-05-06.
`:cite-note-14`!14.`! `F0af`_`[↑`#cite-ref-14]`_`f `*Elixir is a dynamic, functional language designed for building scalable and maintainable applications: elixir-lang/elixir`*, Elixir, 2019-04-21, retrieved 2019-04-21
`:cite-note-elixirhome-15`!15.`! `F0af`_`[↑`#cite-ref-elixirhome-15-0]`_`f "Elixir". Retrieved 2014-09-07.
`:cite-note-16`!16.`! `F0af`_`[↑`#cite-ref-16]`_`f "Writing assertive code with Elixir". 24 September 2014. Retrieved 2018-07-05.
`:cite-note-17`!17.`! `F0af`_`[↑`#cite-ref-17]`_`f `:citerefloder2015`aLoder, Wolfgang (12 May 2015). `*Erlang and Elixir for Imperative Programmers`*. "Chapter 16: Code Structuring Concepts", section title "Actor Model": Leanpub. Retrieved 7 July 2015.`B100`F9d9{{cite book}}`f`b: CS1 maint: location (link)
`:cite-note-18`!18.`! `F0af`_`[↑`#cite-ref-18]`_`f `:citerefwlaschin2013`aWlaschin, Scott (May 2013). "Railway Oriented Programming". `*F# for Fun and Profit`*. Archived from the original on 30 January 2021. Retrieved 28 February 2021.
>>Further reading
• `:citerefsimon-st-laurentj-eisenberg2016`aSimon St. Laurent; J. Eisenberg (December 22, 2016). `*Introducing Elixir: Getting Started in Functional Programming 2nd Edition`*. `F33f`_`[O'Reilly Media`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=O'Reilly_Media]`_`f. `F33f`_`[ISBN`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=ISBN_(identifier)]`_`f 978-1491956779.
• `:citerefsasa-juric2019`aSasa Juric (January 12, 2019). `*Elixir in Action 2nd Edition`*. `F33f`_`[Manning Publications`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Manning_Publications]`_`f. `F33f`_`[ISBN`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=ISBN_(identifier)]`_`f 978-1617295027.
`c`F0af`_`[↑ Back to top`#top]`_`f`a